//
//  WBBaseNavController.swift
//  sinaWeibo
//
//  Created by 吴熠 on 16/11/12.
//  Copyright © 2016年 吴熠. All rights reserved.
//

import UIKit

class WBBaseNavController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

    }
    
    //重写push方法
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        let count = childViewControllers.count
        if count > 0{
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(title:"返回",imageName: "navigationbar_back_withtext", target: self, action: #selector(back))
            //隐藏底部tabbar
//            viewController.hidesBottomBarWhenPushed = true
        }
        
        super.pushViewController(viewController, animated: animated)
        
    }
    @objc private func back(){
        popViewController(animated: true)
    }

}
